<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>VUE模板语法-用户输入</title>
        <style type="text/css">
            .h1 {
                color: blueviolet
            }
            .h2 {
                color: aqua
            }
            .h3 {
                color: burlywood
            }
            .h4 {
                color: cornflowerblue
            }
        </style>
        <script type="text/javascript" src="https://unpkg.com/vue/dist/vue.js"></script>
    </head>
    <body>
        <div id="app">
            <input type="text" v-model="message"/><br/>
            <p class="h1">{{message}}</p>
            <p class="h2">{{message}}</p>
            <p class="h3">{{message}}</p>
            <p class="h4">{{message}}</p>
            <button v-on:click="reset">输入ABC</button>
        </div>
    </body>
    <script type="text/javascript">
        var vueObj = new Vue({
            el: '#app',
            data: {
                message: ''
            },
            methods: {
                reset: function() {
                    this.message = "ABC";
                }
            }
        });
    </script>
</html>